import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 123
 * Date: 2023-04-16
 * Time: 21:06
 */
public class j2023_4_16 {

    public static void main(String[] args) {
        String numWork = "123456";
        Scanner scan = new Scanner (System.in);
        int i=0;


        while(true){
            System.out.println("输入密码");

            String str = scan.nextLine();
            
            if(numWork == str){
                System.out.println("密码正确");
                break;
            }
            else {
                System.out.println("密码错误");
                   i++;

            }
            if(i == 3){
                System.out.println("连续输入错误三，退出程序");
                break;
            }

        }


    }
    public static void main3(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 0;
        while(n!=0){
            i = n % 10 ;
            n /= 10
 ;
            System.out.println(i);
        }




    }

    public static void main2(String[] args) {
        Random random = new Random();
        int num = random.nextInt(100);
        Scanner scan = new Scanner(System.in);

        while(true){
            int n = scan.nextInt();
            if( n > num){
                System.out.println("猜大了");
            }
            else if( n < num){
                System.out.println("猜小了");
            }
            else {
                System.out.println("猜对了");
                break;
            }

        }


    }


}
